package ru.spb.nicetu.altx.mnemo.db.valuetype;

import ru.spb.nicetu.altx.dbadapter.IParamCategory;
import ru.spb.nicetu.altx.dbadapter.IParamDescriptor;
import ru.spb.nicetu.altx.dbadapter.impl.ParamCategory;
import ru.spb.nicetu.altx.dbadapter.impl.ParamDescriptor;
import ru.spb.nicetu.altx.mnemo.extpoint.valuetypes.ATemplateValueType;
import ru.spb.nicetu.altx.mnemo.extpoint.valuetypes.INullCheckable;

@SuppressWarnings("serial")
public class TemplateParamDescriptor extends
        ATemplateValueType<IParamDescriptor>
        implements INullCheckable
{

    private static final String nullName = "?";
    private static final IParamCategory nullCategory = new ParamCategory(nullName);

    public String getName()
    {
        return "Параметр БД";
    }

    public TemplateParamDescriptor()
    {
        super();
        set(new ParamDescriptor(nullName, nullCategory, "", ""," - ", ""));
    }

    public TemplateParamDescriptor(IParamDescriptor value)
    {
        super(value);
    }

    public boolean isNull() {
      IParamDescriptor param = get();
      if (param == null)
        return true;

      return "".equals(param.getID());
    }

}
